package moodish.dummy;

import static org.junit.Assert.*;
import moodish.comm.ServerSideMessage.Type;

import org.junit.AfterClass;
import org.junit.Test;

public class MessageFromClientTest {

	@AfterClass
	public static void tearDownAfterClass() throws Exception {
	}

	@Test
	public void testMessageFromClient() {
		MessageFromClient msg = new MessageFromClient("luis", null, null, null);
		String a = "luis";
		assertSame(msg.getClientNickname(), a);
	}
	
	@Test
	public void testPaylouad(){
		MessageFromClient msg = new MessageFromClient(null, "hello luis", null, Type.MOODISH_MESSAGE);
		String a = "hello luis";
		assertSame(msg.getPayload(), a);
	}
	
	@Test
	public void testPaylouad1(){
		MessageFromClient msg = new MessageFromClient(null, "hello luis", null, null);
		
		assertSame(null, msg.getPayload());
	}
	
	@Test
	public void testType(){
		MessageFromClient msg = new MessageFromClient(null, null, null, Type.FRIENDSHIP);
		MessageFromClient msg1 = new MessageFromClient(null, null, null, Type.FRIENDSHIP);
		assertSame(msg.getType(), msg1.getType());
	}

}
